vector<int> vi;
NumArray(vector<int> &nums)
{
    vi.push_back(0);
    int len = nums.size();
    for (int i = 0; i < len; i++)
    {
        vi.push_back(vi.back() + nums[i]);
    }
}

int sumRange(int left, int right)
{
    return vi[right + 1] - vi[left];
}